package com.lzwk.app.ods.wkForm;

import com.lzwk.common.wkform.WkFormConstant;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;

/**
 * @title: WkFormJDBCTables
 * @Author Yeaser
 * @Date: 2022/2/18 18:53
 * @Version 1.0
 * Description: TODO
 */
public class WkFormJDBCTables {
    public static void wkFormAccountInfo(StreamTableEnvironment tenv) {

        tenv.executeSql(" CREATE TABLE wk_form_account_info ( " +
                "  `id` INT, " +
                "  `age` STRING, " +
                "  `career` STRING, " +
                "  `telephone` STRING, " +
                "  `wechat_nickname` STRING, " +
                "  `gender` INT, " +
                "  primary key (id) not enforced " +
                ") with ( " +
                "  'connector' = 'jdbc', " +
                "  'driver' = 'com.mysql.cj.jdbc.Driver', " +
                "  'url' = 'jdbc:mysql://" + WkFormConstant.WKFORMSLAVEHOST + ":" + WkFormConstant.WKFORMSLAVEPORT + "/" + WkFormConstant.WKFORMSLAVEDBNAME + "?characterEncoding=utf8&serverTimezone=Asia/Shanghai&autoReconnect=true', " +
                "  'table-name' = " + "'" + WkFormConstant.WKFORMJDBCWKFORACCOUNTINTFO + "'" + ", " +
                "  'username'=" + "'" + WkFormConstant.WKFORMSLAVEUSERNAME + "'" + ", " +
                "  'password'=" + "'" + WkFormConstant.WKFORMSLAVEPASSWORD + "'" + ", " +
                "  'lookup.cache.max-rows'='20', " +
                "  'lookup.cache.ttl'='600000' " +
                ")");
    }
}
